<?php
   $lot=$_GET["lot"];
   $dbName = "sqlsrv:Server=172.31.3.9,1433;Database=UFDATA_001_2017";   //这里是服务器IP地址和数据库名，端口不是默认的话记得改一下
   $dbUser = "sa";    //用户名
   $dbPassword = "TDled2017";    //登陆密码
   $db = new PDO($dbName, $dbUser, $dbPassword);   
	$sql = "select OutBoxID  from ldx_SeoulOutBox where  STiaoma='".$lot."'";//
	$res = $db->query($sql);
	$bid="";
	//print_r($res);
	$rdisk="";
	while ($row = $res->fetch()){
		$bid=$row['OutBoxID'];
		$sql = "select Clotno  from ldx_SeoulNeiBoxList where  OutBoxIO= '".$bid."'";//17620T4003-7250613
		$res2 = $db->query($sql);
		//
		$row = null;
		 while ($row = $res2->fetch()){
		  $rdisk.= $row['Clotno'].",";
		 }
		 $rdisk.= "|";
	}
	$res = null;
	$res2 = null;
	$db = null;
	
	print_r($rdisk);
